var $strAcademicoCobrosGeneracionUrl = "admin_academico_cobros_generacion_data.php";
var $strAcademicoCobrosGeneracionForm = "frmAcademicoCobrosGeneracion";
function fntAcademicoCobrosGeneracionFiltro() {
    
    var objInterface = $("#divAcademicoCobrosGeneracionFiltro");
    objInterface.html("");
    $.ajax({

        type: "POST",
        data: $("#"+$strAcademicoCobrosGeneracionForm).serialize(),
        url: $strAcademicoCobrosGeneracionUrl+"?operation=filtro",
        beforeSend:function() {
            fntOpenDialogCargando();
        },
        success:function(data) {
            objInterface.html(data);
            fntCloseDialogCargando();
            
        },
        error:function() {
            fntCloseDialogCargando();
        }

    });
    
}
function fntAcademicoCobrosGeneracionContenido() {
    
    var objInterface = $("#divAcademicoCobrosGeneracionContenido");
    objInterface.html("");
    $.ajax({

        type: "POST",
        data: $("#"+$strAcademicoCobrosGeneracionForm).serialize(),
        url: $strAcademicoCobrosGeneracionUrl+"?operation=contenido",
        beforeSend:function() {
            fntOpenDialogCargando();
        },
        success:function(data) {
            objInterface.html(data);
            fntCloseDialogCargando();
        },
        error:function() {
            fntCloseDialogCargando();
        }

    });
    
}
function fntAcademicoCobrosGeneracionFiltroSeccion() {    
    var objInterface = $("#divAcademicoCobrosGeneracionSeccion");
    objInterface.html("");
    $.ajax({

        type: "POST",
        data: $("#"+$strAcademicoCobrosGeneracionForm).serialize(),
        url: $strAcademicoCobrosGeneracionUrl+"?operation=secciones",
        beforeSend:function() {
        },
        success:function(data) {
            objInterface.html(data);
        }
    });
    
}
function fntAcademicoCobrosGeneracionValidar() {
    strError = "";
    boolReturn = true;
 
    if( !boolReturn )
        alert(strError);
        
    return boolReturn;
    
}
function fntAcademicoCobrosGeneracionGrabar() {
    
    var objInterface = $("#divAcademicoCobrosGeneracionOperaciones");
    objInterface.html("");
    if( fntAcademicoCobrosGeneracionValidar() ) {
        $.ajax({
            type: "POST",
            data: $("#"+$strAcademicoCobrosGeneracionForm).serialize(),
            url: $strAcademicoCobrosGeneracionUrl+"?operation=s",
            beforeSend:function() {
                fntOpenDialogCargando();
            },
            success:function(data) {
                objInterface.html(data);
                fntCloseDialogCargando();
                alert(data);
                fntAcademicoCobrosGeneracionNuevo();                                
            },
            error:function() {
                fntCloseDialogCargando();
            }

        });
    }
    
}
function fntAcademicoCobrosGeneracionNuevo() {
    
    var objInterface = $("#divAcademicoCobrosGeneracionOperaciones");
    objInterface.html("");
    fntAcademicoCobrosGeneracionFiltroSeccion();
	
    objInterface = $("#divAcademicoCobrosGeneracionContenido");
    objInterface.html("");

}

$(function() {
    $("#btnAcademicoCobrosGeneracionNuevo").click( function () {
        fntAcademicoCobrosGeneracionNuevo();
    });
    $("#btnAcademicoCobrosGeneracionGrabar").click( function () {
        fntAcademicoCobrosGeneracionGrabar();
    });
    fntAcademicoCobrosGeneracionFiltro();

});